﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Data.Entity;
using System.Threading.Tasks;
using PublishNews.Entities;

namespace PublishNews.Repositories
{
    public class DistrictRepository : BaseRepository<District>, IDistrictRepository
    {
        public async Task<List<District>> GetDistrictsByLocationId(Guid? locationId)
        {
            using (var context = Context)
            {
                return await context.Set<District>().Where(x => x.LocationId == locationId).ToListAsync();
            }
        }
    }
}